using PnFramework.Unity;
using System.Collections.Generic;
using UnityEngine;

public class LoopUIPanel : MonoBehaviour
{
    private StepListView mRollList;
    private List<int> mBagInfos = new List<int>();

    private void Start()
    {
        for (int i = 0; i < 60; i++)
        {
            mBagInfos.Add(0);
        }
        mRollList = GetComponentInChildren<StepListView>();
        mRollList.Count = mBagInfos.Count;
        mRollList.Init(OnUpdateCell, new GameObjectPool());
        mRollList.ShowMe();
    }
    private void OnUpdateCell(int i)
    {
        mBagInfos[i].ToString();
    }
    private void Update()
    {
        if (Input.GetKeyDown(KeyCode.E)) mRollList.LoopPos();
        else if (Input.GetKeyDown(KeyCode.Q)) mRollList.LoopNeg();
        if (Input.GetKeyDown(KeyCode.A)) mRollList.DirLoop(-1, 0);
        else if (Input.GetKeyDown(KeyCode.D)) mRollList.DirLoop(1, 0);
        else if (Input.GetKeyDown(KeyCode.W)) mRollList.DirLoop(0, 1);
        else if (Input.GetKeyDown(KeyCode.S)) mRollList.DirLoop(0, -1);
    }
}